#!/bin/bash -e
# $Id: install_kernel.sh 717 2010-08-20 14:24:59Z ant_code $

# param: 1: installer / autoinstall

env-update
source /etc/profile
# -ver-
source /gentoo_tmp/env # static values that are changed at runtime are not reflected here, hence control files ?
source /gentoo_tmp/common.fn
source /gentoo_tmp/BOOT

cd /usr/src/linux-${KERNELVERSION}
if [ "$1" = "autoinstall" ]; then
	KCONFIG_ALLCONFIG=${2} make allnoconfig	
else
	KCONFIG_ALLCONFIG=${2} make allnoconfig	
	make menuconfig
fi

make -j2 all || : # for buggy kernel builds
make modules_install

cp -v /usr/src/linux-${KERNELVERSION}/arch/x86/boot/bzImage /boot/${KERNELFILE}
cp -v /usr/src/linux-${KERNELVERSION}/.config /boot/kernel-${KERNELVERSION}.config

# vim: ts=2 syn=sh
# install_kernel.sh: end
